<div class="row-fluid">
	<div class="span12">
		<ul class="breadcrumb">
			<li>
				<a href="index.php">
					<i class="radmin-icon radmin-home"></i> Dashboard
				</a>
				<span class="divider">/</span>
			</li>
			<li class="active">License Details</li>
		</ul>
	</div>
</div>

<div class="row-fluid">
	<div class="span12">
		<h4 class="title"><a href="#"><i class="radmin-icon radmin-help"></i></a> License Details</h4>
		<div class="squiggly-border"></div>
		<?php
			$licenseError = app()->request->getParam('licenseError', null);
		 	if($licenseError): ?>
			<div class="row-fluid">
				<div class="span12">
					<div class="alert alter-block alert-error">
						<button type="button" class="close" data-dismiss="alert">&times;</button>
						<h4>Error</h4>
						<div class="content">
							<?php if($licenseError == 1): ?>
								Your license key is invalid, please input a valid one to refresh it.
							<?php elseif($licenseError == 2): ?>
								Maximum WHM Account limit has been exceeded, you must remove accounts or upgrade your license to continue.
							<?php endif; ?>
						</div>
					</div>
				</div>
			</div>
		<?php endif; ?>

		<strong>License Key:</strong> 
		<?php echo CHtml::textField('licensekey', $licenseDetails['licensekey']); ?>
		<?php echo CHtml::link('Refresh License', '', array(
			'class' => 'btn btn-small btn-primary',
			'id' => 'refresh_license_btn'
		)); ?><br />
		<script>
			$('#refresh_license_btn').click(function(){
				var licensekey = $('#licensekey').val();
				window.location.href = '<?php echo url('default/refreshlicense'); ?>?licensekey='+licensekey;
			});
		</script>
		
		<strong>Status:</strong> <?php echo $licenseDetails['status']; ?><br />
		<strong>Registered To:</strong> <?php echo isset($licenseDetails['registeredname'])? $licenseDetails['registeredname'] : ''; ?><br />
		<strong>Company:</strong> <?php echo isset($licenseDetails['companyname'])? $licenseDetails['companyname'] : ''; ?><br />
		<strong>Email:</strong> <?php echo isset($licenseDetails['email'])? $licenseDetails['email'] : ''; ?><br />
		<strong>Product:</strong> <?php echo isset($licenseDetails['productname'])? $licenseDetails['productname'] : ''; ?><br />
		<strong>Purchase Date:</strong> <?php echo isset($licenseDetails['regdate'])? $licenseDetails['regdate'] : ''; ?><br />
		<strong>Renewal Date:</strong> <?php echo isset($licenseDetails['checkdate'])? date('Y-m-d', strtotime($licenseDetails['checkdate'])) : ''; ?><br />
		<?php if($licenseDetails['message']): ?>
			<strong>Message:</strong> <?php echo $licenseDetails['message']; ?>
		<?php endif; ?>
<!--		<p><a href="http://www.__whatever__.com/client-area/" target="_blank">Click Here</a> for support with your license.</p>-->
	</div>
</div>